<?php

/**
 * TimeCardDay form base class.
 *
 * @method TimeCardDay getObject() Returns the current form's model object
 *
 * @package    virtualstore
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseTimeCardDayForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'time_card_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('TimeCard'), 'add_empty' => false)),
      'date'          => new sfWidgetFormDate(),
      'shift1'        => new sfWidgetFormInputText(),
      'shift2'        => new sfWidgetFormInputText(),
      'shift3'        => new sfWidgetFormInputText(),
      'holiday_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Holiday'), 'add_empty' => true)),
      'restDay'       => new sfWidgetFormInputCheckbox(),
      'position_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Position'), 'add_empty' => true)),
      'shift_day_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ShiftDay'), 'add_empty' => true)),
      'regularHours'  => new sfWidgetFormInputText(),
      'overtimeHours' => new sfWidgetFormInputText(),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
      'created_by'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('created_by_fk'), 'add_empty' => false)),
      'updated_by'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('updated_by_fk'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'time_card_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('TimeCard'))),
      'date'          => new sfValidatorDate(),
      'shift1'        => new sfValidatorString(array('max_length' => 11, 'required' => false)),
      'shift2'        => new sfValidatorString(array('max_length' => 11, 'required' => false)),
      'shift3'        => new sfValidatorString(array('max_length' => 11, 'required' => false)),
      'holiday_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Holiday'), 'required' => false)),
      'restDay'       => new sfValidatorBoolean(array('required' => false)),
      'position_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Position'), 'required' => false)),
      'shift_day_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ShiftDay'), 'required' => false)),
      'regularHours'  => new sfValidatorNumber(array('required' => false)),
      'overtimeHours' => new sfValidatorNumber(array('required' => false)),
      'created_at'    => new sfValidatorDateTime(),
      'updated_at'    => new sfValidatorDateTime(),
      'created_by'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('created_by_fk'))),
      'updated_by'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('updated_by_fk'))),
    ));

    $this->widgetSchema->setNameFormat('time_card_day[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TimeCardDay';
  }

}
